<?php   
	// Interface function   
	function oh_module_kernel($tokens) {
        global $oh_object_kernel;
        return $oh_object_kernel;        
	} 
	
	// Option file required
	//require_once($oh['path']."...");
	//require_once($oh['path']."...");
	
	// Main class of module
	class oh_class_kernel { 
		function oh_class_kernel() {
		}
		function list_modules() {
			global $oh;
			$modules = array();
			$temp_modules = scandir($oh['path']."/modules");			
			foreach($temp_modules as $module) {
				if ($this->is_module_name($module)) {
					$modules[] = $module;
				}
			}
			return $modules;
		}
		function is_module_name($name) {
			if ($name[0] != ".") {
				return true;
			} else {
				return false;
			}
		}
		function register_modules() {
			$ms = $this->list_modules();
			foreach($ms as $m) {
				define($m,$m);
			}
		}
	}
	
	// Main object of module
	global $oh_object_kernel;
	$oh_object_kernel = new oh_class_kernel();
?>
